<template>
  <div class='coun' :style='{"backgroundColor": bianse}'>
    计数: {{getcount}}
    <button @click='add'>+</button>
    <button @click='jian'>-</button>
  </div>
</template>

<script>
import { mapGetters, mapMutations, mapActions } from 'vuex'
export default {
  computed: {
    ...mapGetters('counter', {
      getcount: 'getcount'
    }),
    ...mapGetters('bgc', {
      bianse: 'bianse'
    })
  },
  methods: {
    ...mapActions('counter', {
      jian: ({
        type: 'jian',
        num: 2
      })
    }),
    ...mapMutations('counter', {
      add: 'add'
    })
  }
}
</script>

<style>
  .coun {
    width: 100%;
    height: 100%;
  }
</style>
